package interlocking.model;
//道岔模型
public class Switch {
    private final String id;
    private SwitchPosition position;
    private boolean locked;
    private boolean blocked;
    private final int position_x;
    private final int position_y;

    public Switch(String id,int position_x,int position_y) {
        this.id = id;
        this.position = SwitchPosition.NORMAL;
        this.locked = false;
        this.blocked = false;
        this.position_x=position_x;
        this.position_y=position_y;
    }

    public int getPosition_y() {
        return position_y;
    }

    public int getPosition_x() {
        return position_x;
    }

    // Getters and setters
    public SwitchPosition getPosition() {
        return position;
    }

    public void setPosition(SwitchPosition position) {
        this.position = position;
    }

    public boolean isLocked() {
        return locked;
    }

    public void setLocked(boolean locked) {
        this.locked = locked;
    }

    public boolean isBlocked() {
        return blocked;
    }

    public void setBlocked(boolean blocked) {
        this.blocked = blocked;
    }

    public String getId() {
        return id;
    }

    public enum SwitchPosition {
        NORMAL, REVERSE
    }
}
